//验证手机号
function isPhone(phone) {
    return /^1[34578]\d{9}$/.test(phone);
}

//验证邮箱
function isEmail(email) {
    return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(email);
}

//验证身份证号
function isIdCard(idCard) {
    return /^\d{17}([0-9]|X)$/.test(idCard);
}

module.exports = {
    isPhone: isPhone,
    isEmail: isEmail,
    isIdCard: isIdCard
}